<?php
require('./inc/xhead.php');
$str=iconv("UTF-8","GB2312",$_POST["inputkey"]);
$query = "select top 10 cp.bh,cp.mc,cp.dw,cp.gg,cp.id from sys_cp cp,sys_cpfenl cpfenl where cp.dfl=cpfenl.id and cp.yn=1 and (cp.bh like '%".$str."%' or cp.mc like '%".$str."%') order by cp.bh";
$result=sqlsrv_query($conn,$query);
while($line=sqlsrv_fetch_array($result))
{
	$tmp.="<tr style=\"cursor:pointer\" onmouseover=\"this.bgColor='#93CDDD';\" onmouseout=\"this.bgColor='';\"><td class=seltd onclick=\"{CloseTipDiv();startRequest('".$line[0]."',".$line[4].");}\">".$line[0]."</td><td class=seltd onclick=\"{CloseTipDiv();startRequest('".$line[0]."',".$line[4].");}\">".$line[1]."</td><td class=seltd onclick=\"{CloseTipDiv();startRequest('".$line[0]."',".$line[4].");}\">".$line[2]."</td></tr>";
}
sqlsrv_free_stmt($result);
if($tmp!="")
	echo '<table id="lstab" name="lstab" class=seldiv>',$tmp,'</table>';
else
	echo "no";
?>
